package com.ssy.lingxi.purchase.api.enums.tender;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 专家抽取状态枚举类型
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/6/29
 */
public enum ExpertExtractStatusEnum {

    Not_Send(1, "待发送"),
    Send(2, "待确认"),
    Confirm(3, "已确认"),
    Refuse(4, "已拒绝"),
    Evaluation(5, "已评标");

    private Integer code;
    private String message;

    ExpertExtractStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code){
        ExpertExtractStatusEnum statusEnum = Arrays.stream(ExpertExtractStatusEnum.values()).filter(v -> v.getCode().equals(code)).findAny().orElse(null);
        return null == statusEnum ? "" : LanguageHolder.getName(ExpertExtractStatusEnum.class, statusEnum.getCode());
    }
}
